
    <link rel="stylesheet" type="text/css" href="css/index_top.css">
    <script src="https://unpkg.com/vue"></script>
    <script src="http://cdn.bootcss.com/vue/2.1.0/vue.js" type="text/javascript" charset="utf-8"></script>
    <script src="http://cdn.bootcss.com/vue-resource/1.0.3/vue-resource.js" type="text/javascript" charset="utf-8"></script>

    <div class="index-img"><img src="./images/logo-top.jpg" height="160" width="1000"/></div>
    <div id="nav">
        <ul>
            <li><a href="./index.html">首页</a></li>
        </ul>
        <ul v-for="val in Cate_Content.cates">
        
            <li><a v-bind:href="['./cate_news.html?cate_id='+val.cate_id]">{{val.cate_name}}</a></li>
        </ul>
    </div>

<script>
    new Vue({
        el:'#nav',
        data: {
            Cate_Content:[],
            Cate_content_url: 'http://10.101.147.56/try/news_news/tp5.0/public/cates'  //存数据接口
        },
        created: function(){
            this.getImg() ;      //定义方法
        },
        methods: {
            getImg: function(){
                var that = this;
                that.$http({      //调用接口
                    method:'GET',
                    url:this.Cate_content_url //this指data
                }).then(function(response){ //接口返回数据
                    //console.log(response.data);
                    this.Cate_Content=response.data;
                },function(error){
                    console.log(error);
                })
            }
        }
    })
</script>
